package extras.salvation.api.methods;

import java.awt.Color;

import com.rsbuddy.script.methods.Game;
import com.rsbuddy.script.methods.Skills;
import com.rsbuddy.script.task.Task;

import extras.salvation.api.wrappers.SkillInformation;

/**
 * @author Salvation
 * @version 1.0
 * @since 26-08-2011
 * @see extras.salvation.api.wrappers.SkillInformation
 */
public final class ExtendedSkillInformation {

	private static SkillInformation[] INFO = new SkillInformation[] {
			new SkillInformation("Attack", Skills.ATTACK, Skills
					.getRealLevel(Skills.ATTACK), Skills
					.getRealLevel(Skills.ATTACK), 0, Skills
					.getCurrentExp(Skills.ATTACK), Skills
					.getCurrentExp(Skills.ATTACK), 0,
					getExpToNextLevel(Skills.ATTACK),
					getExpTo99(Skills.ATTACK), getPercentToNext(Skills.ATTACK),
					getPercentTo99(Skills.ATTACK), 0, 0, 0, Color.RED,
					ExtendedPaint.GOLD),
			new SkillInformation("Defense", Skills.DEFENSE, Skills
					.getRealLevel(Skills.DEFENSE), Skills
					.getRealLevel(Skills.DEFENSE), 0, Skills
					.getCurrentExp(Skills.DEFENSE), Skills
					.getCurrentExp(Skills.DEFENSE), 0,
					getExpToNextLevel(Skills.DEFENSE),
					getExpTo99(Skills.DEFENSE),
					getPercentToNext(Skills.DEFENSE),
					getPercentTo99(Skills.DEFENSE), 0, 0, 0, Color.WHITE,
					Color.CYAN),
			new SkillInformation("Strength", Skills.STRENGTH, Skills
					.getRealLevel(Skills.STRENGTH), Skills
					.getRealLevel(Skills.STRENGTH), 0, Skills
					.getCurrentExp(Skills.STRENGTH), Skills
					.getCurrentExp(Skills.STRENGTH), 0,
					getExpToNextLevel(Skills.STRENGTH),
					getExpTo99(Skills.STRENGTH),
					getPercentToNext(Skills.STRENGTH),
					getPercentTo99(Skills.STRENGTH), 0, 0, 0, Color.GREEN,
					Color.RED),
			new SkillInformation("Constitution", Skills.CONSTITUTION, Skills
					.getRealLevel(Skills.CONSTITUTION), Skills
					.getRealLevel(Skills.CONSTITUTION), 0, Skills
					.getCurrentExp(Skills.CONSTITUTION), Skills
					.getCurrentExp(Skills.CONSTITUTION), 0,
					getExpToNextLevel(Skills.CONSTITUTION),
					getExpTo99(Skills.CONSTITUTION),
					getPercentToNext(Skills.CONSTITUTION),
					getPercentTo99(Skills.CONSTITUTION), 0, 0, 0, Color.WHITE,
					Color.RED),
			new SkillInformation("Ranged", Skills.RANGE, Skills
					.getRealLevel(Skills.RANGE), Skills
					.getRealLevel(Skills.RANGE), 0, Skills
					.getCurrentExp(Skills.RANGE), Skills
					.getCurrentExp(Skills.RANGE), 0,
					getExpToNextLevel(Skills.RANGE), getExpTo99(Skills.RANGE),
					getPercentToNext(Skills.RANGE),
					getPercentTo99(Skills.RANGE), 0, 0, 0, Color.GREEN,
					Color.ORANGE),
			new SkillInformation("Prayer", Skills.PRAYER, Skills
					.getRealLevel(Skills.PRAYER), Skills
					.getRealLevel(Skills.PRAYER), 0, Skills
					.getCurrentExp(Skills.PRAYER), Skills
					.getCurrentExp(Skills.PRAYER), 0,
					getExpToNextLevel(Skills.PRAYER),
					getExpTo99(Skills.PRAYER), getPercentToNext(Skills.PRAYER),
					getPercentTo99(Skills.PRAYER), 0, 0, 0, Color.WHITE,
					ExtendedPaint.GOLD),
			new SkillInformation("Magic", Skills.MAGIC, Skills
					.getRealLevel(Skills.MAGIC), Skills
					.getRealLevel(Skills.MAGIC), 0, Skills
					.getCurrentExp(Skills.MAGIC), Skills
					.getCurrentExp(Skills.MAGIC), 0,
					getExpToNextLevel(Skills.MAGIC), getExpTo99(Skills.MAGIC),
					getPercentToNext(Skills.MAGIC),
					getPercentTo99(Skills.MAGIC), 0, 0, 0, Color.WHITE,
					Color.BLUE),
			new SkillInformation("Cooking", Skills.COOKING, Skills
					.getRealLevel(Skills.COOKING), Skills
					.getRealLevel(Skills.COOKING), 0, Skills
					.getCurrentExp(Skills.COOKING), Skills
					.getCurrentExp(Skills.COOKING), 0,
					getExpToNextLevel(Skills.COOKING),
					getExpTo99(Skills.COOKING),
					getPercentToNext(Skills.COOKING),
					getPercentTo99(Skills.COOKING), 0, 0, 0,
					ExtendedPaint.PURPLE, Color.RED),
			new SkillInformation("Woodcutting", Skills.WOODCUTTING, Skills
					.getRealLevel(Skills.WOODCUTTING), Skills
					.getRealLevel(Skills.WOODCUTTING), 0, Skills
					.getCurrentExp(Skills.WOODCUTTING), Skills
					.getCurrentExp(Skills.WOODCUTTING), 0,
					getExpToNextLevel(Skills.WOODCUTTING),
					getExpTo99(Skills.WOODCUTTING),
					getPercentToNext(Skills.WOODCUTTING),
					getPercentTo99(Skills.WOODCUTTING), 0, 0, 0,
					ExtendedPaint.BROWN, Color.GREEN),
			new SkillInformation("Fletching", Skills.FLETCHING, Skills
					.getRealLevel(Skills.FLETCHING), Skills
					.getRealLevel(Skills.FLETCHING), 0, Skills
					.getCurrentExp(Skills.FLETCHING), Skills
					.getCurrentExp(Skills.FLETCHING), 0,
					getExpToNextLevel(Skills.FLETCHING),
					getExpTo99(Skills.FLETCHING),
					getPercentToNext(Skills.FLETCHING),
					getPercentTo99(Skills.FLETCHING), 0, 0, 0, Color.RED,
					ExtendedPaint.GOLD),
			new SkillInformation("Fishing", Skills.FISHING, Skills
					.getRealLevel(Skills.FISHING), Skills
					.getRealLevel(Skills.FISHING), 0, Skills
					.getCurrentExp(Skills.FISHING), Skills
					.getCurrentExp(Skills.FISHING), 0,
					getExpToNextLevel(Skills.FISHING),
					getExpTo99(Skills.FISHING),
					getPercentToNext(Skills.FISHING),
					getPercentTo99(Skills.FISHING), 0, 0, 0, Color.CYAN,
					ExtendedPaint.GOLD),
			new SkillInformation("Firemaking", Skills.FIREMAKING, Skills
					.getRealLevel(Skills.FIREMAKING), Skills
					.getRealLevel(Skills.FIREMAKING), 0, Skills
					.getCurrentExp(Skills.FIREMAKING), Skills
					.getCurrentExp(Skills.FIREMAKING), 0,
					getExpToNextLevel(Skills.FIREMAKING),
					getExpTo99(Skills.FIREMAKING),
					getPercentToNext(Skills.FIREMAKING),
					getPercentTo99(Skills.FIREMAKING), 0, 0, 0, Color.ORANGE,
					ExtendedPaint.GOLD),
			new SkillInformation("Crafting", Skills.CRAFTING, Skills
					.getRealLevel(Skills.CRAFTING), Skills
					.getRealLevel(Skills.CRAFTING), 0, Skills
					.getCurrentExp(Skills.CRAFTING), Skills
					.getCurrentExp(Skills.CRAFTING), 0,
					getExpToNextLevel(Skills.CRAFTING),
					getExpTo99(Skills.CRAFTING),
					getPercentToNext(Skills.CRAFTING),
					getPercentTo99(Skills.CRAFTING), 0, 0, 0,
					ExtendedPaint.BROWN, ExtendedPaint.GOLD),
			new SkillInformation("Smithing", Skills.SMITHING, Skills
					.getRealLevel(Skills.SMITHING), Skills
					.getRealLevel(Skills.SMITHING), 0, Skills
					.getCurrentExp(Skills.SMITHING), Skills
					.getCurrentExp(Skills.SMITHING), 0,
					getExpToNextLevel(Skills.SMITHING),
					getExpTo99(Skills.SMITHING),
					getPercentToNext(Skills.SMITHING),
					getPercentTo99(Skills.SMITHING), 0, 0, 0, Color.GRAY,
					ExtendedPaint.GOLD),
			new SkillInformation("Mining", Skills.MINING, Skills
					.getRealLevel(Skills.MINING), Skills
					.getRealLevel(Skills.MINING), 0, Skills
					.getCurrentExp(Skills.MINING), Skills
					.getCurrentExp(Skills.MINING), 0,
					getExpToNextLevel(Skills.MINING),
					getExpTo99(Skills.MINING), getPercentToNext(Skills.MINING),
					getPercentTo99(Skills.MINING), 0, 0, 0, Color.LIGHT_GRAY,
					Color.CYAN),
			new SkillInformation("Herblore", Skills.HERBLORE, Skills
					.getRealLevel(Skills.HERBLORE), Skills
					.getRealLevel(Skills.HERBLORE), 0, Skills
					.getCurrentExp(Skills.HERBLORE), Skills
					.getCurrentExp(Skills.HERBLORE), 0,
					getExpToNextLevel(Skills.HERBLORE),
					getExpTo99(Skills.HERBLORE),
					getPercentToNext(Skills.HERBLORE),
					getPercentTo99(Skills.HERBLORE), 0, 0, 0, Color.GREEN,
					ExtendedPaint.GOLD),
			new SkillInformation("Agility", Skills.AGILITY, Skills
					.getRealLevel(Skills.AGILITY), Skills
					.getRealLevel(Skills.AGILITY), 0, Skills
					.getCurrentExp(Skills.AGILITY), Skills
					.getCurrentExp(Skills.AGILITY), 0,
					getExpToNextLevel(Skills.AGILITY),
					getExpTo99(Skills.AGILITY),
					getPercentToNext(Skills.AGILITY),
					getPercentTo99(Skills.AGILITY), 0, 0, 0, Color.BLUE,
					Color.RED),
			new SkillInformation("Thieving", Skills.THIEVING, Skills
					.getRealLevel(Skills.THIEVING), Skills
					.getRealLevel(Skills.THIEVING), 0, Skills
					.getCurrentExp(Skills.THIEVING), Skills
					.getCurrentExp(Skills.THIEVING), 0,
					getExpToNextLevel(Skills.THIEVING),
					getExpTo99(Skills.THIEVING),
					getPercentToNext(Skills.THIEVING),
					getPercentTo99(Skills.THIEVING), 0, 0, 0,
					ExtendedPaint.PURPLE, Color.BLACK),
			new SkillInformation("Slayer", Skills.SLAYER, Skills
					.getRealLevel(Skills.SLAYER), Skills
					.getRealLevel(Skills.SLAYER), 0, Skills
					.getCurrentExp(Skills.SLAYER), Skills
					.getCurrentExp(Skills.SLAYER), 0,
					getExpToNextLevel(Skills.SLAYER),
					getExpTo99(Skills.SLAYER), getPercentToNext(Skills.SLAYER),
					getPercentTo99(Skills.SLAYER), 0, 0, 0, Color.BLACK,
					Color.RED),
			new SkillInformation("Farming", Skills.FARMING, Skills
					.getRealLevel(Skills.FARMING), Skills
					.getRealLevel(Skills.FARMING), 0, Skills
					.getCurrentExp(Skills.FARMING), Skills
					.getCurrentExp(Skills.FARMING), 0,
					getExpToNextLevel(Skills.FARMING),
					getExpTo99(Skills.FARMING),
					getPercentToNext(Skills.FARMING),
					getPercentTo99(Skills.FARMING), 0, 0, 0, Color.GREEN,
					ExtendedPaint.LIGHT_GREEN),
			new SkillInformation("RuneCrafting", Skills.RUNECRAFTING, Skills
					.getRealLevel(Skills.RUNECRAFTING), Skills
					.getRealLevel(Skills.RUNECRAFTING), 0, Skills
					.getCurrentExp(Skills.RUNECRAFTING), Skills
					.getCurrentExp(Skills.RUNECRAFTING), 0,
					getExpToNextLevel(Skills.RUNECRAFTING),
					getExpTo99(Skills.RUNECRAFTING),
					getPercentToNext(Skills.RUNECRAFTING),
					getPercentTo99(Skills.RUNECRAFTING), 0, 0, 0, Color.WHITE,
					ExtendedPaint.GOLD),
			new SkillInformation("Hunter", Skills.HUNTER, Skills
					.getRealLevel(Skills.HUNTER), Skills
					.getRealLevel(Skills.HUNTER), 0, Skills
					.getCurrentExp(Skills.HUNTER), Skills
					.getCurrentExp(Skills.HUNTER), 0,
					getExpToNextLevel(Skills.HUNTER),
					getExpTo99(Skills.HUNTER), getPercentToNext(Skills.HUNTER),
					getPercentTo99(Skills.HUNTER), 0, 0, 0,
					ExtendedPaint.BROWN, Color.BLACK),
			new SkillInformation("Construction", Skills.CONSTRUCTION, Skills
					.getRealLevel(Skills.CONSTRUCTION), Skills
					.getRealLevel(Skills.CONSTRUCTION), 0, Skills
					.getCurrentExp(Skills.CONSTRUCTION), Skills
					.getCurrentExp(Skills.CONSTRUCTION), 0,
					getExpToNextLevel(Skills.CONSTRUCTION),
					getExpTo99(Skills.CONSTRUCTION),
					getPercentToNext(Skills.CONSTRUCTION),
					getPercentTo99(Skills.CONSTRUCTION), 0, 0, 0, Color.WHITE,
					ExtendedPaint.GOLD),
			new SkillInformation("Summoning", Skills.SUMMONING, Skills
					.getRealLevel(Skills.SUMMONING), Skills
					.getRealLevel(Skills.SUMMONING), 0, Skills
					.getCurrentExp(Skills.SUMMONING), Skills
					.getCurrentExp(Skills.SUMMONING), 0,
					getExpToNextLevel(Skills.SUMMONING),
					getExpTo99(Skills.SUMMONING),
					getPercentToNext(Skills.SUMMONING),
					getPercentTo99(Skills.SUMMONING), 0, 0, 0, Color.WHITE,
					ExtendedPaint.GOLD),
			new SkillInformation("Dungeoneering", Skills.DUNGEONEERING, Skills
					.getRealLevel(Skills.DUNGEONEERING), Skills
					.getRealLevel(Skills.DUNGEONEERING), 0, Skills
					.getCurrentExp(Skills.DUNGEONEERING), Skills
					.getCurrentExp(Skills.DUNGEONEERING), 0,
					getExpToNextLevel(Skills.DUNGEONEERING),
					getExpTo99(Skills.DUNGEONEERING),
					getPercentToNext(Skills.DUNGEONEERING),
					getPercentTo99(Skills.DUNGEONEERING), 0, 0, 0,
					ExtendedPaint.LIGHT_BROWN, Color.BLACK),
			new SkillInformation("Money Making", 25, 0, 0, 0, 0, 0, 0, 0, 0, 0,
					0, 0, (long) 0, (long) 0, Color.GRAY, Color.BLACK) };

	/**
	 * @author Salvation
	 * @description Use this method to reset the current statistics, for example
	 *              when a skill has been obtained wrongly during onStart!
	 */
	public static void reset() {
		while (!Game.isLoggedIn()
				|| Skills.getRealLevel(Skills.CONSTITUTION) < 10) {
			Task.sleep(1000);
		}
		INFO = new SkillInformation[] {
				new SkillInformation("Attack", Skills.ATTACK, Skills
						.getRealLevel(Skills.ATTACK), Skills
						.getRealLevel(Skills.ATTACK), 0, Skills
						.getCurrentExp(Skills.ATTACK), Skills
						.getCurrentExp(Skills.ATTACK), 0,
						getExpToNextLevel(Skills.ATTACK),
						getExpTo99(Skills.ATTACK),
						getPercentToNext(Skills.ATTACK),
						getPercentTo99(Skills.ATTACK), 0, 0, 0, Color.RED,
						ExtendedPaint.GOLD),
				new SkillInformation("Defense", Skills.DEFENSE, Skills
						.getRealLevel(Skills.DEFENSE), Skills
						.getRealLevel(Skills.DEFENSE), 0, Skills
						.getCurrentExp(Skills.DEFENSE), Skills
						.getCurrentExp(Skills.DEFENSE), 0,
						getExpToNextLevel(Skills.DEFENSE),
						getExpTo99(Skills.DEFENSE),
						getPercentToNext(Skills.DEFENSE),
						getPercentTo99(Skills.DEFENSE), 0, 0, 0, Color.WHITE,
						Color.CYAN),
				new SkillInformation("Strength", Skills.STRENGTH, Skills
						.getRealLevel(Skills.STRENGTH), Skills
						.getRealLevel(Skills.STRENGTH), 0, Skills
						.getCurrentExp(Skills.STRENGTH), Skills
						.getCurrentExp(Skills.STRENGTH), 0,
						getExpToNextLevel(Skills.STRENGTH),
						getExpTo99(Skills.STRENGTH),
						getPercentToNext(Skills.STRENGTH),
						getPercentTo99(Skills.STRENGTH), 0, 0, 0, Color.GREEN,
						Color.RED),
				new SkillInformation("Constitution", Skills.CONSTITUTION,
						Skills.getRealLevel(Skills.CONSTITUTION), Skills
								.getRealLevel(Skills.CONSTITUTION), 0, Skills
								.getCurrentExp(Skills.CONSTITUTION), Skills
								.getCurrentExp(Skills.CONSTITUTION), 0,
						getExpToNextLevel(Skills.CONSTITUTION),
						getExpTo99(Skills.CONSTITUTION),
						getPercentToNext(Skills.CONSTITUTION),
						getPercentTo99(Skills.CONSTITUTION), 0, 0, 0,
						Color.WHITE, Color.RED),
				new SkillInformation("Ranged", Skills.RANGE, Skills
						.getRealLevel(Skills.RANGE), Skills
						.getRealLevel(Skills.RANGE), 0, Skills
						.getCurrentExp(Skills.RANGE), Skills
						.getCurrentExp(Skills.RANGE), 0,
						getExpToNextLevel(Skills.RANGE),
						getExpTo99(Skills.RANGE),
						getPercentToNext(Skills.RANGE),
						getPercentTo99(Skills.RANGE), 0, 0, 0, Color.GREEN,
						Color.ORANGE),
				new SkillInformation("Prayer", Skills.PRAYER, Skills
						.getRealLevel(Skills.PRAYER), Skills
						.getRealLevel(Skills.PRAYER), 0, Skills
						.getCurrentExp(Skills.PRAYER), Skills
						.getCurrentExp(Skills.PRAYER), 0,
						getExpToNextLevel(Skills.PRAYER),
						getExpTo99(Skills.PRAYER),
						getPercentToNext(Skills.PRAYER),
						getPercentTo99(Skills.PRAYER), 0, 0, 0, Color.WHITE,
						ExtendedPaint.GOLD),
				new SkillInformation("Magic", Skills.MAGIC, Skills
						.getRealLevel(Skills.MAGIC), Skills
						.getRealLevel(Skills.MAGIC), 0, Skills
						.getCurrentExp(Skills.MAGIC), Skills
						.getCurrentExp(Skills.MAGIC), 0,
						getExpToNextLevel(Skills.MAGIC),
						getExpTo99(Skills.MAGIC),
						getPercentToNext(Skills.MAGIC),
						getPercentTo99(Skills.MAGIC), 0, 0, 0, Color.WHITE,
						Color.BLUE),
				new SkillInformation("Cooking", Skills.COOKING, Skills
						.getRealLevel(Skills.COOKING), Skills
						.getRealLevel(Skills.COOKING), 0, Skills
						.getCurrentExp(Skills.COOKING), Skills
						.getCurrentExp(Skills.COOKING), 0,
						getExpToNextLevel(Skills.COOKING),
						getExpTo99(Skills.COOKING),
						getPercentToNext(Skills.COOKING),
						getPercentTo99(Skills.COOKING), 0, 0, 0,
						ExtendedPaint.PURPLE, Color.RED),
				new SkillInformation("Woodcutting", Skills.WOODCUTTING, Skills
						.getRealLevel(Skills.WOODCUTTING), Skills
						.getRealLevel(Skills.WOODCUTTING), 0, Skills
						.getCurrentExp(Skills.WOODCUTTING), Skills
						.getCurrentExp(Skills.WOODCUTTING), 0,
						getExpToNextLevel(Skills.WOODCUTTING),
						getExpTo99(Skills.WOODCUTTING),
						getPercentToNext(Skills.WOODCUTTING),
						getPercentTo99(Skills.WOODCUTTING), 0, 0, 0,
						ExtendedPaint.BROWN, Color.GREEN),
				new SkillInformation("Fletching", Skills.FLETCHING, Skills
						.getRealLevel(Skills.FLETCHING), Skills
						.getRealLevel(Skills.FLETCHING), 0, Skills
						.getCurrentExp(Skills.FLETCHING), Skills
						.getCurrentExp(Skills.FLETCHING), 0,
						getExpToNextLevel(Skills.FLETCHING),
						getExpTo99(Skills.FLETCHING),
						getPercentToNext(Skills.FLETCHING),
						getPercentTo99(Skills.FLETCHING), 0, 0, 0, Color.RED,
						ExtendedPaint.GOLD),
				new SkillInformation("Fishing", Skills.FISHING, Skills
						.getRealLevel(Skills.FISHING), Skills
						.getRealLevel(Skills.FISHING), 0, Skills
						.getCurrentExp(Skills.FISHING), Skills
						.getCurrentExp(Skills.FISHING), 0,
						getExpToNextLevel(Skills.FISHING),
						getExpTo99(Skills.FISHING),
						getPercentToNext(Skills.FISHING),
						getPercentTo99(Skills.FISHING), 0, 0, 0, Color.CYAN,
						ExtendedPaint.GOLD),
				new SkillInformation("Firemaking", Skills.FIREMAKING, Skills
						.getRealLevel(Skills.FIREMAKING), Skills
						.getRealLevel(Skills.FIREMAKING), 0, Skills
						.getCurrentExp(Skills.FIREMAKING), Skills
						.getCurrentExp(Skills.FIREMAKING), 0,
						getExpToNextLevel(Skills.FIREMAKING),
						getExpTo99(Skills.FIREMAKING),
						getPercentToNext(Skills.FIREMAKING),
						getPercentTo99(Skills.FIREMAKING), 0, 0, 0,
						Color.ORANGE, ExtendedPaint.GOLD),
				new SkillInformation("Crafting", Skills.CRAFTING, Skills
						.getRealLevel(Skills.CRAFTING), Skills
						.getRealLevel(Skills.CRAFTING), 0, Skills
						.getCurrentExp(Skills.CRAFTING), Skills
						.getCurrentExp(Skills.CRAFTING), 0,
						getExpToNextLevel(Skills.CRAFTING),
						getExpTo99(Skills.CRAFTING),
						getPercentToNext(Skills.CRAFTING),
						getPercentTo99(Skills.CRAFTING), 0, 0, 0,
						ExtendedPaint.BROWN, ExtendedPaint.GOLD),
				new SkillInformation("Smithing", Skills.SMITHING, Skills
						.getRealLevel(Skills.SMITHING), Skills
						.getRealLevel(Skills.SMITHING), 0, Skills
						.getCurrentExp(Skills.SMITHING), Skills
						.getCurrentExp(Skills.SMITHING), 0,
						getExpToNextLevel(Skills.SMITHING),
						getExpTo99(Skills.SMITHING),
						getPercentToNext(Skills.SMITHING),
						getPercentTo99(Skills.SMITHING), 0, 0, 0, Color.GRAY,
						ExtendedPaint.GOLD),
				new SkillInformation("Mining", Skills.MINING, Skills
						.getRealLevel(Skills.MINING), Skills
						.getRealLevel(Skills.MINING), 0, Skills
						.getCurrentExp(Skills.MINING), Skills
						.getCurrentExp(Skills.MINING), 0,
						getExpToNextLevel(Skills.MINING),
						getExpTo99(Skills.MINING),
						getPercentToNext(Skills.MINING),
						getPercentTo99(Skills.MINING), 0, 0, 0,
						Color.LIGHT_GRAY, Color.CYAN),
				new SkillInformation("Herblore", Skills.HERBLORE, Skills
						.getRealLevel(Skills.HERBLORE), Skills
						.getRealLevel(Skills.HERBLORE), 0, Skills
						.getCurrentExp(Skills.HERBLORE), Skills
						.getCurrentExp(Skills.HERBLORE), 0,
						getExpToNextLevel(Skills.HERBLORE),
						getExpTo99(Skills.HERBLORE),
						getPercentToNext(Skills.HERBLORE),
						getPercentTo99(Skills.HERBLORE), 0, 0, 0, Color.GREEN,
						ExtendedPaint.GOLD),
				new SkillInformation("Agility", Skills.AGILITY, Skills
						.getRealLevel(Skills.AGILITY), Skills
						.getRealLevel(Skills.AGILITY), 0, Skills
						.getCurrentExp(Skills.AGILITY), Skills
						.getCurrentExp(Skills.AGILITY), 0,
						getExpToNextLevel(Skills.AGILITY),
						getExpTo99(Skills.AGILITY),
						getPercentToNext(Skills.AGILITY),
						getPercentTo99(Skills.AGILITY), 0, 0, 0, Color.BLUE,
						Color.RED),
				new SkillInformation("Thieving", Skills.THIEVING, Skills
						.getRealLevel(Skills.THIEVING), Skills
						.getRealLevel(Skills.THIEVING), 0, Skills
						.getCurrentExp(Skills.THIEVING), Skills
						.getCurrentExp(Skills.THIEVING), 0,
						getExpToNextLevel(Skills.THIEVING),
						getExpTo99(Skills.THIEVING),
						getPercentToNext(Skills.THIEVING),
						getPercentTo99(Skills.THIEVING), 0, 0, 0,
						ExtendedPaint.PURPLE, Color.BLACK),
				new SkillInformation("Slayer", Skills.SLAYER, Skills
						.getRealLevel(Skills.SLAYER), Skills
						.getRealLevel(Skills.SLAYER), 0, Skills
						.getCurrentExp(Skills.SLAYER), Skills
						.getCurrentExp(Skills.SLAYER), 0,
						getExpToNextLevel(Skills.SLAYER),
						getExpTo99(Skills.SLAYER),
						getPercentToNext(Skills.SLAYER),
						getPercentTo99(Skills.SLAYER), 0, 0, 0, Color.BLACK,
						Color.RED),
				new SkillInformation("Farming", Skills.FARMING, Skills
						.getRealLevel(Skills.FARMING), Skills
						.getRealLevel(Skills.FARMING), 0, Skills
						.getCurrentExp(Skills.FARMING), Skills
						.getCurrentExp(Skills.FARMING), 0,
						getExpToNextLevel(Skills.FARMING),
						getExpTo99(Skills.FARMING),
						getPercentToNext(Skills.FARMING),
						getPercentTo99(Skills.FARMING), 0, 0, 0, Color.GREEN,
						ExtendedPaint.LIGHT_GREEN),
				new SkillInformation("RuneCrafting", Skills.RUNECRAFTING,
						Skills.getRealLevel(Skills.RUNECRAFTING), Skills
								.getRealLevel(Skills.RUNECRAFTING), 0, Skills
								.getCurrentExp(Skills.RUNECRAFTING), Skills
								.getCurrentExp(Skills.RUNECRAFTING), 0,
						getExpToNextLevel(Skills.RUNECRAFTING),
						getExpTo99(Skills.RUNECRAFTING),
						getPercentToNext(Skills.RUNECRAFTING),
						getPercentTo99(Skills.RUNECRAFTING), 0, 0, 0,
						Color.WHITE, ExtendedPaint.GOLD),
				new SkillInformation("Hunter", Skills.HUNTER, Skills
						.getRealLevel(Skills.HUNTER), Skills
						.getRealLevel(Skills.HUNTER), 0, Skills
						.getCurrentExp(Skills.HUNTER), Skills
						.getCurrentExp(Skills.HUNTER), 0,
						getExpToNextLevel(Skills.HUNTER),
						getExpTo99(Skills.HUNTER),
						getPercentToNext(Skills.HUNTER),
						getPercentTo99(Skills.HUNTER), 0, 0, 0,
						ExtendedPaint.BROWN, Color.BLACK),
				new SkillInformation("Construction", Skills.CONSTRUCTION,
						Skills.getRealLevel(Skills.CONSTRUCTION), Skills
								.getRealLevel(Skills.CONSTRUCTION), 0, Skills
								.getCurrentExp(Skills.CONSTRUCTION), Skills
								.getCurrentExp(Skills.CONSTRUCTION), 0,
						getExpToNextLevel(Skills.CONSTRUCTION),
						getExpTo99(Skills.CONSTRUCTION),
						getPercentToNext(Skills.CONSTRUCTION),
						getPercentTo99(Skills.CONSTRUCTION), 0, 0, 0,
						Color.WHITE, ExtendedPaint.GOLD),
				new SkillInformation("Summoning", Skills.SUMMONING, Skills
						.getRealLevel(Skills.SUMMONING), Skills
						.getRealLevel(Skills.SUMMONING), 0, Skills
						.getCurrentExp(Skills.SUMMONING), Skills
						.getCurrentExp(Skills.SUMMONING), 0,
						getExpToNextLevel(Skills.SUMMONING),
						getExpTo99(Skills.SUMMONING),
						getPercentToNext(Skills.SUMMONING),
						getPercentTo99(Skills.SUMMONING), 0, 0, 0, Color.WHITE,
						ExtendedPaint.GOLD),
				new SkillInformation("Dungeoneering", Skills.DUNGEONEERING,
						Skills.getRealLevel(Skills.DUNGEONEERING), Skills
								.getRealLevel(Skills.DUNGEONEERING), 0, Skills
								.getCurrentExp(Skills.DUNGEONEERING), Skills
								.getCurrentExp(Skills.DUNGEONEERING), 0,
						getExpToNextLevel(Skills.DUNGEONEERING),
						getExpTo99(Skills.DUNGEONEERING),
						getPercentToNext(Skills.DUNGEONEERING),
						getPercentTo99(Skills.DUNGEONEERING), 0, 0, 0,
						ExtendedPaint.LIGHT_BROWN, Color.BLACK),
				new SkillInformation("Money Making", 25, 0, 0, 0, 0, 0, 0, 0,
						0, 0, 0, 0, (long) 0, (long) 0, Color.GRAY, Color.BLACK) };
	}

	/**
	 * @author Salvation
	 * @param skill
	 *            The index of the skill found in the Skills class.
	 * @return The SkillInformation
	 */
	public static SkillInformation getSkillInfomation(final int skill) {
		return INFO[skill];
	}

	/**
	 * @author Salvation
	 * @description Updates cached statistics, do not call this method within
	 *              onRepaint but in Loop!
	 * @param skill
	 *            -1 to update all skills, otherwise the skill's index in the
	 *            Skills class.
	 * @see com.rsbuddy.script.methods.Skills
	 */
	public static void updateSkill(final int skill) {
		switch (skill) {
		case -1:
			for (int i = 0; i < INFO.length - 1; i++) {
				update(INFO[i].getSkill());
			}
			break;
		case 25:
			break;
		default:
			update(skill);
		}
	}

	private static int getExpToNextLevel(final int skill) {
		final int level = Skills.getRealLevel(skill);
		if (level == 120)
			return 0;
		final int expToGo = Skills.XP_TABLE[level + 1]
				- Skills.getCurrentExp(skill);
		return expToGo > 0 ? expToGo : 0;
	}

	private static int getExpTo99(final int skill) {
		final int expToGo = Skills.XP_TABLE[99] - Skills.getCurrentExp(skill);
		return expToGo > 0 ? expToGo : 0;
	}

	private static int getPercentTo99(final int skill) {
		final int level = Skills.getRealLevel(skill);
		if (level >= 99)
			return 100;
		final int cur = Skills.getCurrentExp(skill);
		final int min = Skills.XP_TABLE[level];
		final int max = Skills.XP_TABLE[99];
		final int todo = max - min;
		final int done = cur - min;
		return 100 * done / todo;
	}

	private static int getPercentToNext(final int skill) {
		final int level = Skills.getRealLevel(skill);
		if (level >= 120)
			return 100;
		final int cur = Skills.getCurrentExp(skill);
		final int min = Skills.XP_TABLE[level];
		final int max = Skills.XP_TABLE[level + 1];
		final int todo = max - min;
		final int done = cur - min;
		return 100 * done / todo;
	}

	private static long getTimeToLevel(final int togo, final int xph) {
		if (xph == 0)
			return 0;
		return (long) (togo * 3600000D) / xph;
	}

	private static void update(final int skill) {
		final SkillInformation si = getSkillInfomation(skill);
		final String name = si.getName();
		final int startLevel = si.getStartLevel();
		final int currentLevel = Skills.getRealLevel(skill);
		final int gainedLevel = currentLevel - startLevel;
		final int startExperience = si.getStartExperience();
		final int currentExperience = Skills.getCurrentExp(skill);
		final int gainedExperience = currentExperience - startExperience;
		final int gainedExperienceHour = ExtendedCalculations
				.getPerHour(gainedExperience);
		final int toNextLevelExperience = getExpToNextLevel(skill);
		final int to99Experience = getExpTo99(skill);
		final int toNextLevelPercent = getPercentToNext(skill);
		final int to99Percent = getPercentTo99(skill);
		final long timeToLevel = getTimeToLevel(toNextLevelExperience,
				gainedExperienceHour);
		final long timeTo99 = getTimeToLevel(to99Experience,
				gainedExperienceHour);
		final Color color = si.getColor();
		final Color colorFont = si.getFontColor();
		INFO[skill] = new SkillInformation(name, skill, startLevel,
				currentLevel, gainedLevel, startExperience, currentExperience,
				gainedExperience, gainedExperienceHour, toNextLevelExperience,
				to99Experience, toNextLevelPercent, to99Percent, timeToLevel,
				timeTo99, color, colorFont);
	}
}